﻿using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.ServiceLocation;
using TFS.Kanban.Commons.Commands;
using TFS.Kanban.Constants;
using TFS.Kanban.Modules.Dashboard.Views;

namespace TFS.Kanban.Modules.Dashboard.Commands
{
    public class NavigateToDashboardCommand : CommandBase
    {
        public override string Name
        {
            get { return "Dashboard"; }
        }

        public override void Execute(object parameter)
        {
            //TODO: Refactor this to an event once we have established event pattern (ie: which Event Aggregator)
            var regionManager = ServiceLocator.Current.GetInstance<IRegionManager>();
            regionManager.RequestNavigate(RegionNames.Main, typeof(DashboardView).ToString());
        }
    }
}
